/* 业务逻辑 */
(function() {
    Path.on(["/__basename__.html", "/"], function() {
        App.set("$Cache.current_page", 1);
    });
    //随机获取商品
    coAjax.get(appConfig.goods.list_random, {
        bus_id: busInfo._id,
        num: 8,
        page: 0
    }, function(result) {
        App.set("$Cache.main.random_goods", result.result);
    }, function() {
        console.log(arguments);
    });

    // 搜索
    App.set('$Event.href', function() {
        if (App.get('$Cache.search_text')) {
            Path.jump("searchset.html?q=" + App.get('$Cache.search_text'))
        } else {
            alert('error', '请输入搜索关键词');
        };
    });

}());

/*交互*/
;
